package cn.enjoy.dynamic.datasource.service.impl;

import cn.enjoy.dynamic.datasource.mapper.UserMapper;
import cn.enjoy.dynamic.datasource.service.IUserService;
import cn.enjoy.entity.User;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author K
 */
@Service
@AllArgsConstructor
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    private UserMapper userMapper;


    @Override
    public User selectByIdMaster(Long id) {
        return userMapper.selectById(id);
    }

    @Override
    @DS("slave_1")
    public User selectByIdSlave1(Long id) {
        return userMapper.selectById(id);
    }


}
